//
//  TabbarManager.m
//  ocdemo
//
//  Created by mac on 2025/10/12.
//

#import "TabbarManager.h"

@implementation TabbarManager
{
    bool hasListeners;
}
RCT_EXPORT_MODULE();
- (dispatch_queue_t)methodQueue {
    return dispatch_get_main_queue();
}

- (void)startObserving{
    hasListeners=YES;
}
- (void)stopObserving{
    hasListeners=NO;
}
-(NSArray<NSString *> *)supportedEvents{
    return @[@"Tabbarchanged"];
}
-(void)didSelecTabbarWithIndex:(NSInteger )index{
    if(hasListeners){
        [self sendEventWithName:@"Tabbarchanged" body:@{@"tabbarIndex":@(index)}];
    }
}
@end
